package com.ibeeking.found.common.enums;

/**
 * @Author ibeeking
 * @Date: 2021-01-05 19:15
 * @Description: 号码规则
 */
public enum NoRuleEnum {
    STR("字符", 1, ""),
    NYR("年月日", 2, "YYYYMMDD"),
    NUM_RANDOM("随机数", 3, ""),
    ;
    private String name;
    private Integer code;
    private String remarks;


    NoRuleEnum(String name, int code, String remarks) {
        this.code = code;
        this.name = name;
        this.remarks = remarks;
    }

    public String getName() {
        return name;
    }

    public String getRemarks() {
        return remarks;
    }

    public Integer getCode() {
        return code;
    }

    public static NoRuleEnum getEnumByCode(Integer code) {
        for (NoRuleEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }
}
